<template>
  <div>
    从前有座上，上山有座庙，庙里没人.............
    <p>
      倒计时，<span>{{ time }}</span
      >调回首页
    </p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      timer: null,
      time: 3
    }
  },
  mounted() {
    this.timer = setInterval(() => {
      this.time--
      if (this.time === 0) {
        this.$router.push('/')
        clearInterval(this.timer)
      }
    }, 1000)
  }
}
</script>

<style lang="less" scoped></style>
